home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / fastfred.c < prev    next >
C/C++ Source or Header  |  2000-04-23  |  24KB  |  680 lines

  1. /***************************************************************************
  2.  
  3. Fast Freddie/Jump Coaster memory map (preliminary)
  4.  
  5. driver by Zsolt Vasvari
  6.  
  7. These games run on a modified Galaxian board.
  8.  
  9. Main CPU
  10.  
  11. Fast Fred  Jump Coas
  12. 0000-7fff             ROM
  13. c000-c7ff             RAM
  14. d000-d3ff  d800-dbff  Video RAM
  15. d400-d7ff  dc00-dfff  Mirrored Video RAM
  16. d800-d83f  d000-d03f  Attributes RAM
  17. d840-d85f  d040-d05f  Sprite RAM
  18.  
  19. I/O read:
  20.  
  21. c800-cfff             Custom I/O (Protection)
  22. e000       e802       Input Port 1
  23. e800       e803       Input Port 2
  24. f000       e800       Dip Switches
  25. f800                  Watchdog Reset
  26.  
  27. I/O write:
  28.  
  29. c800-cfff             Custom I/O write
  30. e000                  Background color write
  31. fXX1                  NMI Enable
  32. fXX2-fXX3             Palette Select (?)
  33. fXX4-fXX5             Character Bank Select
  34. fXX6                  Screen Flip X
  35. fXX7                  Screen Flip Y
  36.  
  37. f800                  Sound Command Write (AY8910 #1 Control Port on Jump Coaster)
  38. f801                  AY8910 #1 Write Port on Jump Coaster
  39.  
  40.  
  41. Sound CPU (Only on Fast Freddie)
  42.  
  43. 0000-1fff ROM
  44. 2000-23ff RAM
  45.  
  46. I/O read:
  47.  
  48. 3000 Sound Command Read
  49.  
  50. I/O write:
  51.  
  52. 3000 NMI Enable
  53. 4000 Reset PSG's (?)
  54. 5000 AY8910 #1 Control Port
  55. 5001 AY8910 #1 Write Port
  56. 6000 AY8910 #2 Control Port
  57. 6001 AY8910 #2 Write Port
  58.  
  59. ***************************************************************************/
  60.  
  61. #include "driver.h"
  62. #include "vidhrdw/generic.h"
  63.  
  64. extern unsigned char *galaxian_attributesram;
  65. WRITE_HANDLER( galaxian_attributes_w );
  66.  
  67. void fastfred_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  68. void fastfred_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  69. WRITE_HANDLER( fastfred_character_bank_select_w );
  70. WRITE_HANDLER( fastfred_color_bank_select_w );
  71. WRITE_HANDLER( fastfred_background_color_w );
  72. WRITE_HANDLER( fastfred_flipx_w );
  73. WRITE_HANDLER( fastfred_flipy_w );
  74. void jumpcoas_init_machine(void);
  75.  
  76. static READ_HANDLER( jumpcoas_custom_io_r )
  77. {
  78.     if (offset == 0x100)  return 0x63;
  79.  
  80.     return 0x00;
  81. }
  82.  
  83. // This routine is a big hack, but the only way I can get the game working
  84. // without knowing anything about the way the protection chip works.
  85. // These values were derived based on disassembly of the code. Usually, it
  86. // was pretty obvious what the values should be. Of course, this will have
  87. // to change if a different ROM set ever surfaces.
  88. static READ_HANDLER( fastfred_custom_io_r )
  89. {
  90.     switch (cpu_get_pc())
  91.     {
  92.     case 0x03c0: return 0x9d;
  93.     case 0x03e6: return 0x9f;
  94.     case 0x0407: return 0x00;
  95.     case 0x0446: return 0x94;
  96.     case 0x049f: return 0x01;
  97.     case 0x04b1: return 0x00;
  98.     case 0x0dd2: return 0x00;
  99.     case 0x0de4: return 0x20;
  100.     case 0x122b: return 0x10;
  101.     case 0x123d: return 0x00;
  102.     case 0x1a83: return 0x10;
  103.     case 0x1a93: return 0x00;
  104.     case 0x1b26: return 0x00;
  105.     case 0x1b37: return 0x80;
  106.     case 0x2491: return 0x10;
  107.     case 0x24a2: return 0x00;
  108.     case 0x46ce: return 0x20;
  109.     case 0x46df: return 0x00;
  110.     case 0x7b18: return 0x01;
  111.     case 0x7b29: return 0x00;
  112.     case 0x7b47: return 0x00;
  113.     case 0x7b58: return 0x20;
  114.     }
  115.  
  116.     logerror("Uncaught custom I/O read %04X at %04X\n", 0xc800+offset, cpu_get_pc());
  117.     return 0x00;
  118. }
  119.  
  120.  
  121. static struct MemoryReadAddress fastfred_readmem[] =
  122. {
  123.     { 0x0000, 0x7fff, MRA_ROM },
  124.     { 0x8000, 0x9fff, MRA_NOP }, // There is a bug in Fast Freddie that causes
  125.                                  // these locations to be read. See 1b5a
  126.                                  // One of the instructions should be ld de,
  127.                                  // instead of ld hl,
  128.     { 0xc000, 0xc7ff, MRA_RAM },
  129.     { 0xd000, 0xd3ff, MRA_RAM },
  130.     { 0xd800, 0xd8ff, MRA_RAM },
  131.     { 0xe000, 0xe000, input_port_0_r },
  132.     { 0xe800, 0xe800, input_port_1_r },
  133.     { 0xf000, 0xf000, input_port_2_r },
  134.     { 0xf800, 0xf800, watchdog_reset_r },
  135.     { -1 }  /* end of table */
  136. };
  137.  
  138. static struct MemoryWriteAddress fastfred_writemem[] =
  139. {
  140.     { 0x0000, 0x7fff, MWA_ROM },
  141.     { 0xc000, 0xc7ff, MWA_RAM },
  142.     { 0xc800, 0xcfff, MWA_NOP },
  143.     { 0xd000, 0xd3ff, videoram_w, &videoram, &videoram_size },
  144.     { 0xd400, 0xd7ff, videoram_w },  // Mirrored for above
  145.     { 0xd800, 0xd83f, galaxian_attributes_w, &galaxian_attributesram },
  146.     { 0xd840, 0xd85f, MWA_RAM, &spriteram, &spriteram_size },
  147.     { 0xd860, 0xdbff, MWA_RAM }, // Unused, but initialized
  148.     { 0xe000, 0xe000, fastfred_background_color_w },
  149.     { 0xf000, 0xf000, MWA_NOP }, // Unused, but initialized
  150.     { 0xf001, 0xf001, interrupt_enable_w },
  151.     { 0xf002, 0xf003, fastfred_color_bank_select_w },
  152.     { 0xf004, 0xf005, fastfred_character_bank_select_w },
  153.     { 0xf006, 0xf006, fastfred_flipx_w },
  154.     { 0xf007, 0xf007, fastfred_flipy_w },
  155.     { 0xf116, 0xf116, fastfred_flipx_w },
  156.     { 0xf117, 0xf117, fastfred_flipy_w },
  157.     { 0xf800, 0xf800, soundlatch_w },
  158.     { -1 }  /* end of table */
  159. };
  160.  
  161.  
  162. static struct MemoryReadAddress jumpcoas_readmem[] =
  163. {
  164.     { 0x0000, 0x7fff, MRA_ROM },
  165.     { 0xc000, 0xc7ff, MRA_RAM },
  166.     { 0xd000, 0xd3ff, MRA_RAM },
  167.     { 0xd800, 0xdbff, MRA_RAM },
  168.     { 0xe800, 0xe800, input_port_0_r },
  169.     { 0xe802, 0xe802, input_port_1_r },
  170.     { 0xe802, 0xe803, input_port_2_r },
  171.     //{ 0xf800, 0xf800, watchdog_reset_r },  // Why doesn't this work???
  172.     { 0xf800, 0xf800, MRA_NOP },
  173.     { -1 }  /* end of table */
  174. };
  175.  
  176.  
  177. static struct MemoryWriteAddress jumpcoas_writemem[] =
  178. {
  179.     { 0x0000, 0x7fff, MWA_ROM },
  180.     { 0xc000, 0xc7ff, MWA_RAM },
  181.     { 0xc800, 0xcfff, MWA_NOP },
  182.     { 0xd000, 0xd03f, galaxian_attributes_w, &galaxian_attributesram },
  183.     { 0xd040, 0xd05f, MWA_RAM, &spriteram, &spriteram_size },
  184.     { 0xd060, 0xd3ff, MWA_NOP },
  185.     { 0xd800, 0xdbff, videoram_w, &videoram, &videoram_size },
  186.     { 0xdc00, 0xdfff, videoram_w },    /* mirror address, used in the name entry screen */
  187.     { 0xe000, 0xe000, fastfred_background_color_w },
  188.     { 0xf000, 0xf000, MWA_NOP }, // Unused, but initialized
  189.     { 0xf001, 0xf001, interrupt_enable_w },
  190.     { 0xf002, 0xf003, fastfred_color_bank_select_w },
  191.     { 0xf004, 0xf005, fastfred_character_bank_select_w },
  192.     { 0xf006, 0xf006, fastfred_flipx_w },
  193.     { 0xf007, 0xf007, fastfred_flipy_w },
  194.     { 0xf116, 0xf116, fastfred_flipx_w },
  195.     { 0xf117, 0xf117, fastfred_flipy_w },
  196.     { 0xf800, 0xf800, AY8910_control_port_0_w },
  197.     { 0xf801, 0xf801, AY8910_write_port_0_w },
  198.     { -1 }  /* end of table */
  199. };
  200.  
  201.  
  202. static struct MemoryReadAddress sound_readmem[] =
  203. {
  204.     { 0x0000, 0x1fff, MRA_ROM },
  205.     { 0x2000, 0x23ff, MRA_RAM },
  206.     { 0x3000, 0x3000, soundlatch_r },
  207.     { -1 }  /* end of table */
  208. };
  209.  
  210.  
  211. static struct MemoryWriteAddress sound_writemem[] =
  212. {
  213.     { 0x2000, 0x23ff, MWA_RAM },
  214.     { 0x3000, 0x3000, interrupt_enable_w },
  215.     { 0x4000, 0x4000, MWA_RAM },  // Reset PSG's
  216.     { 0x5000, 0x5000, AY8910_control_port_0_w },
  217.     { 0x5001, 0x5001, AY8910_write_port_0_w },
  218.     { 0x6000, 0x6000, AY8910_control_port_1_w },
  219.     { 0x6001, 0x6001, AY8910_write_port_1_w },
  220.     { -1 }  /* end of table */
  221. };
  222.  
  223.  
  224. INPUT_PORTS_START( fastfred )
  225.     PORT_START      /* IN1 */
  226.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  227.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  228.     PORT_SERVICE( 0x04, IP_ACTIVE_HIGH )
  229.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 )
  230.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
  231.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN3 )
  232.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_8WAY )
  233.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_8WAY | IPF_COCKTAIL )
  234.  
  235.     PORT_START      /* IN2 */
  236.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_8WAY )
  237.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  238.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
  239.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  240.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY )
  241.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY )
  242.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
  243.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
  244.  
  245.     PORT_START      /* DSW 1 */
  246.     PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coinage ) )
  247.     PORT_DIPSETTING(    0x01, "A 2/1 B 2/1" )
  248.     PORT_DIPSETTING(    0x02, "A 2/1 B 1/3" )
  249.     PORT_DIPSETTING(    0x00, "A 1/1 B 1/1" )
  250.     PORT_DIPSETTING(    0x03, "A 1/1 B 1/2" )
  251.     PORT_DIPSETTING(    0x04, "A 1/1 B 1/3" )
  252.     PORT_DIPSETTING(    0x05, "A 1/1 B 1/4" )
  253.     PORT_DIPSETTING(    0x06, "A 1/1 B 1/5" )
  254.     PORT_DIPSETTING(    0x07, "A 1/1 B 1/6" )
  255.     PORT_DIPSETTING(    0x08, "A 1/2 B 1/2" )
  256.     PORT_DIPSETTING(    0x09, "A 1/2 B 1/4" )
  257.     PORT_DIPSETTING(    0x0a, "A 1/2 B 1/5" )
  258.     PORT_DIPSETTING(    0x0e, "A 1/2 B 1/6" )
  259.     PORT_DIPSETTING(    0x0b, "A 1/2 B 1/10" )
  260.     PORT_DIPSETTING(    0x0c, "A 1/2 B 1/11" )
  261.     PORT_DIPSETTING(    0x0d, "A 1/2 B 1/12" )
  262.     PORT_DIPSETTING(    0x0f, DEF_STR( Free_Play ) )
  263.     PORT_DIPNAME( 0x10, 0x00, DEF_STR( Lives ) )
  264.     PORT_DIPSETTING(    0x00, "3" )
  265.     PORT_DIPSETTING(    0x10, "5" )
  266.     PORT_DIPNAME( 0x60, 0x20, DEF_STR( Bonus_Life ) )
  267.     PORT_DIPSETTING(    0x20, "30000" )
  268.     PORT_DIPSETTING(    0x40, "50000" )
  269.     PORT_DIPSETTING(    0x60, "100000" )
  270.     PORT_DIPSETTING(    0x00, "None" )
  271.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
  272.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  273.     PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
  274. INPUT_PORTS_END
  275.  
  276. INPUT_PORTS_START( flyboy )
  277.     PORT_START      /* IN1 */
  278.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  279.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  280.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
  281.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 )
  282.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
  283.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
  284.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_8WAY )
  285.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_8WAY | IPF_COCKTAIL )
  286.  
  287.     PORT_START      /* IN2 */
  288.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_8WAY )
  289.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  290.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
  291.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  292.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY )
  293.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY )
  294.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
  295.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
  296.  
  297.     PORT_START      /* DSW 1 */
  298.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
  299.     PORT_DIPSETTING(    0x03, DEF_STR( 6C_1C ) )
  300.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
  301.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  302.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
  303.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) )
  304.     PORT_DIPSETTING(    0x0c, DEF_STR( 6C_1C ) )
  305.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  306.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  307.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
  308.     PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
  309.     PORT_DIPSETTING(    0x00, "3" )
  310.     PORT_DIPSETTING(    0x10, "5" )
  311.     PORT_DIPSETTING(    0x20, "7" )
  312.     PORT_BITX( 0,       0x30, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "255", IP_KEY_NONE, IP_JOY_NONE )
  313.     PORT_DIPNAME( 0x40, 0x00, "Invincibility" )
  314.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  315.     PORT_BITX( 0,       0x40, IPT_DIPSWITCH_SETTING | IPF_CHEAT, DEF_STR( On ), IP_KEY_NONE, IP_JOY_NONE )
  316.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
  317.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  318.     PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
  319. INPUT_PORTS_END
  320.  
  321. INPUT_PORTS_START( jumpcoas )
  322.     PORT_START      /* DSW 0 */
  323.     PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coin_A ) )
  324.     PORT_DIPSETTING(    0x03, DEF_STR( 6C_1C ) )
  325.     PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
  326.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  327.     PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
  328.     PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coin_B ) )
  329.     PORT_DIPSETTING(    0x0c, DEF_STR( 6C_1C ) )
  330.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  331.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  332.     PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
  333.     PORT_DIPNAME( 0x30, 0x00, DEF_STR( Lives ) )
  334.     PORT_DIPSETTING(    0x00, "3" )
  335.     PORT_DIPSETTING(    0x10, "5" )
  336.     PORT_DIPSETTING(    0x20, "7" )
  337.     PORT_BITX( 0,       0x30, IPT_DIPSWITCH_SETTING | IPF_CHEAT, "255", IP_KEY_NONE, IP_JOY_NONE )
  338.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
  339.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  340.     PORT_DIPSETTING(    0x40, DEF_STR( On ) )
  341.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
  342.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  343.     PORT_DIPSETTING(    0x80, DEF_STR( Cocktail ) )
  344.  
  345.     PORT_START      /* IN1 */
  346.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
  347.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
  348.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  349.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 )
  350.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 )
  351.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
  352.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 )
  353.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_COCKTAIL )
  354.  
  355.     PORT_START      /* IN2 */
  356.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_8WAY )
  357.     PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  358.     PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
  359.     PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  360.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY )
  361.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY )
  362.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
  363.     PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
  364. INPUT_PORTS_END
  365.  
  366.  
  367. static struct GfxLayout fastfred_charlayout =
  368. {
  369.     8,8,    /* 8*8 characters */
  370.     1024,   /* 1024 characters */
  371.     3,      /* 3 bits per pixel */
  372.     { 0x4000*8, 0x2000*8, 0 }, /* the three bitplanes are separated */
  373.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  374.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  375.     8*8     /* every char takes 8 consecutive bytes */
  376. };
  377.  
  378. static struct GfxLayout jumpcoas_charlayout =
  379. {
  380.     8,8,    /* 8*8 characters */
  381.     256,    /* 256 characters */
  382.     3,      /* 3 bits per pixel */
  383.     { 0x2000*8, 0x1000*8, 0 }, /* the three bitplanes are separated */
  384.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  385.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  386.     8*8     /* every char takes 8 consecutive bytes */
  387. };
  388.  
  389. static struct GfxLayout fastfred_spritelayout =
  390. {
  391.     16,16,  /* 16*16 sprites */
  392.     128,    /* 128 sprites */
  393.     3,      /* 3 bits per pixel */
  394.     { 0x2000*8, 0x1000*8, 0 }, /* the three bitplanes are separated */
  395.     { 0, 1, 2, 3, 4, 5, 6, 7,
  396.       8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
  397.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  398.             16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
  399.     32*8     /* every sprite takes 32 consecutive bytes */
  400. };
  401.  
  402. static struct GfxLayout jumpcoas_spritelayout =
  403. {
  404.     16,16,  /* 16*16 sprites */
  405.     64,     /* 64 sprites */
  406.     3,      /* 3 bits per pixel */
  407.     { 0x2000*8, 0x1000*8, 0 }, /* the three bitplanes are separated */
  408.     { 0, 1, 2, 3, 4, 5, 6, 7,
  409.       8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
  410.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
  411.             16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
  412.     32*8     /* every sprite takes 32 consecutive bytes */
  413. };
  414.  
  415. static struct GfxDecodeInfo fastfred_gfxdecodeinfo[] =
  416. {
  417.     { REGION_GFX1, 0, &fastfred_charlayout,     0, 32 },
  418.     { REGION_GFX2, 0, &fastfred_spritelayout,   0, 32 },
  419.     { -1 } /* end of array */
  420. };
  421.  
  422. static struct GfxDecodeInfo jumpcoas_gfxdecodeinfo[] =
  423. {
  424.     { REGION_GFX1, 0x0000, &jumpcoas_charlayout,     0, 32 },
  425.     { REGION_GFX1, 0x0800, &jumpcoas_spritelayout,   0, 32 },
  426.     { -1 } /* end of array */
  427. };
  428.  
  429.  
  430. #define CLOCK 18432000  /* The crystal is 18.432Mhz */
  431.  
  432. static struct AY8910interface fastfred_ay8910_interface =
  433. {
  434.     2,             /* 2 chips */
  435.     CLOCK/12,       /* ? */
  436.     { 25, 25 },
  437.     { 0 },
  438.     { 0 },
  439.     { 0 },
  440.     { 0 }
  441. };
  442.  
  443. static struct AY8910interface jumpcoas_ay8910_interface =
  444. {
  445.     1,             /* 1 chip */
  446.     CLOCK/12,       /* ? */
  447.     { 25 },
  448.     { 0 },
  449.     { 0 },
  450.     { 0 },
  451.     { 0 }
  452. };
  453.  
  454.  
  455. static struct MachineDriver machine_driver_fastfred =
  456. {
  457.     /* basic machine hardware */
  458.     {
  459.         {
  460.             CPU_Z80,
  461.             CLOCK/6,     /* 3.072 Mhz */
  462.             fastfred_readmem,fastfred_writemem,0,0,
  463.             nmi_interrupt,1
  464.         },
  465.         {
  466.             CPU_Z80 | CPU_AUDIO_CPU,
  467.             CLOCK/12,    /* 1.536 Mhz */
  468.             sound_readmem,sound_writemem,0,0,
  469.             nmi_interrupt,4
  470.         }
  471.     },
  472.     60, CLOCK/16/60,       /* frames per second, vblank duration */
  473.     1,      /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  474.     0,
  475.  
  476.     /* video hardware */
  477.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  478.     fastfred_gfxdecodeinfo,
  479.     256,32*8,
  480.     fastfred_vh_convert_color_prom,
  481.  
  482.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  483.     0,
  484.     generic_vh_start,
  485.     generic_vh_stop,
  486.     fastfred_vh_screenrefresh,
  487.  
  488.     /* sound hardware */
  489.     0,0,0,0,
  490.     {
  491.         {
  492.             SOUND_AY8910,
  493.             &fastfred_ay8910_interface
  494.         }
  495.     }
  496. };
  497.  
  498. static struct MachineDriver machine_driver_jumpcoas =
  499. {
  500.     /* basic machine hardware */
  501.     {
  502.         {
  503.             CPU_Z80,
  504.             CLOCK/6,     /* 3.072 Mhz */
  505.             jumpcoas_readmem,jumpcoas_writemem,0,0,
  506.             nmi_interrupt,1
  507.         }
  508.     },
  509.     60, CLOCK/16/60,       /* frames per second, vblank duration */
  510.     1,      /* Single CPU game */
  511.     jumpcoas_init_machine,
  512.  
  513.     /* video hardware */
  514.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  515.     jumpcoas_gfxdecodeinfo,
  516.     256,32*8,
  517.     fastfred_vh_convert_color_prom,
  518.  
  519.     VIDEO_TYPE_RASTER,
  520.     0,
  521.     generic_vh_start,
  522.     generic_vh_stop,
  523.     fastfred_vh_screenrefresh,
  524.  
  525.     /* sound hardware */
  526.     0,0,0,0,
  527.     {
  528.         {
  529.             SOUND_AY8910,
  530.             &jumpcoas_ay8910_interface
  531.         }
  532.     }
  533. };
  534.  
  535. #undef CLOCK
  536.  
  537. /***************************************************************************
  538.  
  539.   Game driver(s)
  540.  
  541. ***************************************************************************/
  542.  
  543. ROM_START( fastfred )
  544.     ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for main CPU */
  545.     ROM_LOAD( "ffr.01",       0x0000, 0x1000, 0x15032c13 )
  546.     ROM_LOAD( "ffr.02",       0x1000, 0x1000, 0xf9642744 )
  547.     ROM_LOAD( "ffr.03",       0x2000, 0x1000, 0xf0919727 )
  548.     ROM_LOAD( "ffr.04",       0x3000, 0x1000, 0xc778751e )
  549.     ROM_LOAD( "ffr.05",       0x4000, 0x1000, 0xcd6e160a )
  550.     ROM_LOAD( "ffr.06",       0x5000, 0x1000, 0x67f7f9b3 )
  551.     ROM_LOAD( "ffr.07",       0x6000, 0x1000, 0x2935c76a )
  552.     ROM_LOAD( "ffr.08",       0x7000, 0x1000, 0x0fb79e7b )
  553.  
  554.     ROM_REGION( 0x10000, REGION_CPU2 )     /* 64k for audio CPU */
  555.     ROM_LOAD( "ffr.09",       0x0000, 0x1000, 0xa1ec8d7e )
  556.     ROM_LOAD( "ffr.10",       0x1000, 0x1000, 0x460ca837 )
  557.  
  558.     ROM_REGION( 0x6000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  559.     ROM_LOAD( "ffr.14",       0x0000, 0x1000, 0xe8a00e81 )
  560.     ROM_LOAD( "ffr.17",       0x1000, 0x1000, 0x701e0f01 )
  561.     ROM_LOAD( "ffr.15",       0x2000, 0x1000, 0xb49b053f )
  562.     ROM_LOAD( "ffr.18",       0x3000, 0x1000, 0x4b208c8b )
  563.     ROM_LOAD( "ffr.16",       0x4000, 0x1000, 0x8c686bc2 )
  564.     ROM_LOAD( "ffr.19",       0x5000, 0x1000, 0x75b613f6 )
  565.  
  566.     ROM_REGION( 0x3000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  567.     ROM_LOAD( "ffr.11",       0x0000, 0x1000, 0x0e1316d4 )
  568.     ROM_LOAD( "ffr.12",       0x1000, 0x1000, 0x94c06686 )
  569.     ROM_LOAD( "ffr.13",       0x2000, 0x1000, 0x3fcfaa8e )
  570.  
  571.     ROM_REGION( 0x0300, REGION_PROMS )
  572.     ROM_LOAD( "flyboy.red",   0x0000, 0x0100, 0xb801e294 )
  573.     ROM_LOAD( "flyboy.grn",   0x0100, 0x0100, 0x7da063d0 )
  574.     ROM_LOAD( "flyboy.blu",   0x0200, 0x0100, 0x85c05c18 )
  575. ROM_END
  576.  
  577. ROM_START( flyboy )
  578.     ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for main CPU */
  579.     ROM_LOAD( "flyboy01.cpu", 0x0000, 0x1000, 0xb05aa900 )
  580.     ROM_LOAD( "flyboy02.cpu", 0x1000, 0x1000, 0x474867f5 )
  581.     ROM_LOAD( "rom3.cpu",     0x2000, 0x1000, 0xd2f8f085 )
  582.     ROM_LOAD( "rom4.cpu",     0x3000, 0x1000, 0x19e5e15c )
  583.     ROM_LOAD( "flyboy05.cpu", 0x4000, 0x1000, 0x207551f7 )
  584.     ROM_LOAD( "rom6.cpu",     0x5000, 0x1000, 0xf5464c72 )
  585.     ROM_LOAD( "rom7.cpu",     0x6000, 0x1000, 0x50a1baff )
  586.     ROM_LOAD( "rom8.cpu",     0x7000, 0x1000, 0xfe2ae95d )
  587.  
  588.     ROM_REGION( 0x10000, REGION_CPU2 )     /* 64k for audio CPU */
  589.     ROM_LOAD( "rom9.cpu",     0x0000, 0x1000, 0x5d05d1a0 )
  590.     ROM_LOAD( "rom10.cpu",    0x1000, 0x1000, 0x7a28005b )
  591.  
  592.     ROM_REGION( 0x6000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  593.     ROM_LOAD( "rom14.rom",    0x0000, 0x1000, 0xaeb07260 )
  594.     ROM_LOAD( "rom17.rom",    0x1000, 0x1000, 0xa834325b )
  595.     ROM_LOAD( "rom15.rom",    0x2000, 0x1000, 0xc10c7ce2 )
  596.     ROM_LOAD( "rom18.rom",    0x3000, 0x1000, 0x2f196c80 )
  597.     ROM_LOAD( "rom16.rom",    0x4000, 0x1000, 0x719246b1 )
  598.     ROM_LOAD( "rom19.rom",    0x5000, 0x1000, 0x00c1c5d2 )
  599.  
  600.     ROM_REGION( 0x3000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  601.     ROM_LOAD( "rom11.rom",    0x0000, 0x1000, 0xee7ec342 )
  602.     ROM_LOAD( "rom12.rom",    0x1000, 0x1000, 0x84d03124 )
  603.     ROM_LOAD( "rom13.rom",    0x2000, 0x1000, 0xfcb33ff4 )
  604.  
  605.     ROM_REGION( 0x0300, REGION_PROMS )
  606.     ROM_LOAD( "flyboy.red",   0x0000, 0x0100, 0xb801e294 )
  607.     ROM_LOAD( "flyboy.grn",   0x0100, 0x0100, 0x7da063d0 )
  608.     ROM_LOAD( "flyboy.blu",   0x0200, 0x0100, 0x85c05c18 )
  609. ROM_END
  610.  
  611. ROM_START( flyboyb )
  612.     ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for main CPU */
  613.     ROM_LOAD( "rom1.cpu",     0x0000, 0x1000, 0xe9e1f527 )
  614.     ROM_LOAD( "rom2.cpu",     0x1000, 0x1000, 0x07fbe78c )
  615.     ROM_LOAD( "rom3.cpu",     0x2000, 0x1000, 0xd2f8f085 )
  616.     ROM_LOAD( "rom4.cpu",     0x3000, 0x1000, 0x19e5e15c )
  617.     ROM_LOAD( "rom5.cpu",     0x4000, 0x1000, 0xd56872ea )
  618.     ROM_LOAD( "rom6.cpu",     0x5000, 0x1000, 0xf5464c72 )
  619.     ROM_LOAD( "rom7.cpu",     0x6000, 0x1000, 0x50a1baff )
  620.     ROM_LOAD( "rom8.cpu",     0x7000, 0x1000, 0xfe2ae95d )
  621.  
  622.     ROM_REGION( 0x10000, REGION_CPU2 )     /* 64k for audio CPU */
  623.     ROM_LOAD( "rom9.cpu",     0x0000, 0x1000, 0x5d05d1a0 )
  624.     ROM_LOAD( "rom10.cpu",    0x1000, 0x1000, 0x7a28005b )
  625.  
  626.     ROM_REGION( 0x6000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  627.     ROM_LOAD( "rom14.rom",    0x0000, 0x1000, 0xaeb07260 )
  628.     ROM_LOAD( "rom17.rom",    0x1000, 0x1000, 0xa834325b )
  629.     ROM_LOAD( "rom15.rom",    0x2000, 0x1000, 0xc10c7ce2 )
  630.     ROM_LOAD( "rom18.rom",    0x3000, 0x1000, 0x2f196c80 )
  631.     ROM_LOAD( "rom16.rom",    0x4000, 0x1000, 0x719246b1 )
  632.     ROM_LOAD( "rom19.rom",    0x5000, 0x1000, 0x00c1c5d2 )
  633.  
  634.     ROM_REGION( 0x3000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  635.     ROM_LOAD( "rom11.rom",    0x0000, 0x1000, 0xee7ec342 )
  636.     ROM_LOAD( "rom12.rom",    0x1000, 0x1000, 0x84d03124 )
  637.     ROM_LOAD( "rom13.rom",    0x2000, 0x1000, 0xfcb33ff4 )
  638.  
  639.     ROM_REGION( 0x0300, REGION_PROMS )
  640.     ROM_LOAD( "flyboy.red",   0x0000, 0x0100, 0xb801e294 )
  641.     ROM_LOAD( "flyboy.grn",   0x0100, 0x0100, 0x7da063d0 )
  642.     ROM_LOAD( "flyboy.blu",   0x0200, 0x0100, 0x85c05c18 )
  643. ROM_END
  644.  
  645. ROM_START( jumpcoas )
  646.     ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
  647.     ROM_LOAD( "jumpcoas.001", 0x0000, 0x2000, 0x0778c953 )
  648.     ROM_LOAD( "jumpcoas.002", 0x2000, 0x2000, 0x57f59ce1 )
  649.     ROM_LOAD( "jumpcoas.003", 0x4000, 0x2000, 0xd9fc93be )
  650.     ROM_LOAD( "jumpcoas.004", 0x6000, 0x2000, 0xdc108fc1 )
  651.  
  652.     ROM_REGION( 0x3000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  653.     ROM_LOAD( "jumpcoas.005", 0x0000, 0x1000, 0x2dce6b07 )
  654.     ROM_LOAD( "jumpcoas.006", 0x1000, 0x1000, 0x0d24aa1b )
  655.     ROM_LOAD( "jumpcoas.007", 0x2000, 0x1000, 0x14c21e67 )
  656.  
  657.     ROM_REGION( 0x0300, REGION_PROMS )
  658.     ROM_LOAD( "jumpcoas.red", 0x0000, 0x0100, 0x13714880 )
  659.     ROM_LOAD( "jumpcoas.gre", 0x0100, 0x0100, 0x05354848 )
  660.     ROM_LOAD( "jumpcoas.blu", 0x0200, 0x0100, 0xf4662db7 )
  661. ROM_END
  662.  
  663.  
  664. static void init_fastfred(void)
  665. {
  666.     install_mem_read_handler(0, 0xc800, 0xcfff, fastfred_custom_io_r);
  667. }
  668.  
  669. static void init_jumpcoas(void)
  670. {
  671.     install_mem_read_handler(0, 0xc800, 0xcfff, jumpcoas_custom_io_r);
  672. }
  673.  
  674.  
  675.  
  676. GAMEX(1982, flyboy,   0,      fastfred, flyboy,   0,        ROT90, "Kaneko", "Fly-Boy", GAME_NOT_WORKING )    /* protection */
  677. GAME( 1982, flyboyb,  flyboy, fastfred, flyboy,   0,        ROT90, "Kaneko", "Fly-Boy (bootleg)" )
  678. GAME( 1982, fastfred, flyboy, fastfred, fastfred, fastfred, ROT90, "Atari", "Fast Freddie" )
  679. GAME( 1983, jumpcoas, 0,      jumpcoas, jumpcoas, jumpcoas, ROT90, "Kaneko", "Jump Coaster" )
  680.